<template>
  <div>
    <el-table :data="tableData">
      <el-table-column align="center"
                       prop="name"
                       label="姓名">
      </el-table-column>
      <el-table-column align="center"
                       prop="age"
                       label="年龄">
      </el-table-column>
      <el-table-column align="center"
                       prop="marriage"
                       label="婚否">
      </el-table-column>
      <el-table-column align="center"
                       prop="politics"
                       label="政治面貌">
      </el-table-column>
      <el-table-column align="center"
                       prop="career"
                       label="职业">
      </el-table-column>
      <el-table-column align="center"
                       prop="arms"
                       label="服役单位">
      </el-table-column>
      <el-table-column align="center"
                       prop="start_time"
                       label="入伍时间">
      </el-table-column>
      <el-table-column align="center"
                       prop="end_time"
                       label="转业时间">
      </el-table-column>
      <el-table-column align="center"
                       label="地址">
        <template slot-scope="scope">
          <el-popover placement="top-start"
                      title="详细地址"
                      width="300"
                      trigger="hover"
                      :content="`${scope.row.province}${scope.row.city}${scope.row.county}${scope.row.address}`">
            <el-button slot="reference"
                       type="text"
                       class="ellipsis">{{`${scope.row.province}${scope.row.city}${scope.row.county}${scope.row.address}`}}</el-button>
          </el-popover>
        </template>
      </el-table-column>
    </el-table>
    <v-pagination :total='total'
                  :page.sync='page'
                  @pagination='init' />
  </div>
</template>

<script>
export default {
  data () {
    return {
      tableData: [],
      total: 0,
      page: 1

    }
  },
  methods: {
    async init () {
      try {
        const res = await this.api.auditlist({ page: this.page })
        this.tableData = res.data.list || []
        this.total = res.data.rows || 0
      } catch (err) {
        throw (err)
      }
    }


  },
  mounted () {
    this.init()
  }
}
</script>

<style>
</style>
